# Scrapy项目设置
BOT_NAME = 'stock_spider'

SPIDER_MODULES = ['stock_spider.spiders']
NEWSPIDER_MODULE = 'stock_spider.spiders'

# 遵守robots.txt规则（设为False以便爬取）
ROBOTSTXT_OBEY = False

# 下载延迟（避免请求过快）
DOWNLOAD_DELAY = 1

# 启用管道及优先级
ITEM_PIPELINES = {
    'stock_spider.pipelines.ConsolePipeline': 300,  # 控制台输出
    'stock_spider.pipelines.MySQLPipeline': 400,     # 数据库存储
}

# 日志级别
LOG_LEVEL = 'INFO'

# User-Agent设置
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'

# 并发设置
CONCURRENT_REQUESTS = 16
CONCURRENT_REQUESTS_PER_DOMAIN = 8